package net.chrisrichardson.ec2deployer.cluster

import net.chrisrichardson.ec2deployer.core.EC2Server

class ClusterHosts {
    List tomcats
    EC2Server apacheServer
    EC2Server databaseServer
    List mySqlSlaves
    EC2Server jmeter
    List terracottaHosts

    def getTomcatsIterator() {
        tomcats.iterator()
    }

    def getMySqlSlavesIterator() {
        mySqlSlaves.iterator()
    }

    def getHosts() {
        def hosts = new HashSet()
        hosts.addAll(tomcats)
        hosts.add(apacheServer)
        hosts.add(databaseServer)
        hosts.addAll(mySqlSlaves)
        hosts.addAll(terracottaHosts)
        hosts.add(jmeter)
        hosts
    }

    def waitUntilRunning() {
        hosts*.waitUntilRunning()
    }
}